package com.yunfei.schedule.util;

import com.yunfei.entity.messageSendDtl.MessageSendDtlEntity;
import com.yunfei.mapper.aiiidb.YuYueJinEBuZuMessageForLiCaiShiMapper;
import com.yunfei.utils.ComponentFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.*;

/**
 * @program: springclould_ylcaifu_App
 * @description:
 * @author: zhengyunfei
 * @create: 2019-03-21 14:38
 **/
@Component
public class RemindTask extends TimerTask {
    private Timer timer;
    public RemindTask() {
    }
    public RemindTask(Timer timer) {
        this.timer = timer;
    }
    public void run() {
        YuYueJinEBuZuMessageForLiCaiShiMapper daoZhangQueRenMessageForLiCaiShiMapper = ComponentFactory.getBean(YuYueJinEBuZuMessageForLiCaiShiMapper.class);
        Map<String,Object> paramMap=new HashMap<>();
        //获取刚刚存入的消息ID
        List<MessageSendDtlEntity> messageSendList= daoZhangQueRenMessageForLiCaiShiMapper.findAllList(paramMap);
        //第二步激光推送消息
        System.out.println("定时任务按时出发了。。。。。"+messageSendList.size());
        this.timer.cancel();
    }
}